﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Styx;
using Styx.Common;
using Styx.CommonBot;
using Styx.CommonBot.Inventory;
using Styx.CommonBot.POI;
using Styx.CommonBot.Routines;
using Styx.Helpers;
using Styx.Pathing;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;

namespace UltraFTW.data.libs.util
{
    public class FTWCondition
    {
        public string type = "";
        public string target_str = "";
        public WoWUnit target { get { FTWLogger.debug(target_str); return FTWUtils.getWoWUnitFromStr(target_str); } }
        public string aura_action = "";
        public string aura = "";
        public string prop = "";
        public string op = "";
        public double value;
        public string value_str = "";
        public string raw_str = "";
        
        public override string ToString()
        {
            string c_str = "";
            c_str += "Type=" + type + ",";
            c_str += "Target=" + target_str + ",";
            c_str += "AuraAction=" + aura_action + ",";
            c_str += "Aura=" + aura + ",";
            c_str += "Prop=" + prop + ",";
            c_str += "Operator=" + op + ",";
            c_str += "Value=" + value.ToString();
            c_str += "ValueStr=" + value_str.ToString();
            return c_str;
        }
    }

    public delegate bool FTWActionFuncHandler(FTWAction act_obj, Dictionary<string, string> vals, Dictionary<string, bool> flags);
    
    public class FTWAction
    {
        public string target_str = "";
        public WoWUnit target { get { return FTWUtils.getWoWUnitFromStr(target_str); } }
        public string action = "";
        public string param = "";
        public WoWSpell spell;
        public string raw_str = "";

        public Dictionary<string, string> action_opts_vals = new Dictionary<string, string>();
        public Dictionary<string, bool> action_opts_flags = new Dictionary<string, bool>();
        public FTWActionFuncHandler action_func;
        
        public bool Execute()
        {
            return action_func(this, action_opts_vals, action_opts_flags);
        }
    }
    public class FTWRetCode
    {
        public bool status = false;
        public bool success = false;
        public bool failed = false;
        public Object value;
        public Dictionary<string, double> num_flags;
        public Dictionary<string, bool> flags;
        public Dictionary<string, string> err_msgs;
    }
}
